//
//  YQLocationManager.h
//  YQLocation
//
//  Created by sz on 2018/11/12.
//  Copyright © 2018 yq. All rights reserved.
//   使用之前要初始化
//   [AMapServices sharedServices].apiKey = AUTONaviKey;

#import <Foundation/Foundation.h>
#import <MAMapKit/MAMapKit.h>
#import <AMapFoundationKit/AMapFoundationKit.h>
#import <AMapLocationKit/AMapLocationKit.h>
#import <AMapSearchKit/AMapSearchKit.h>
NS_ASSUME_NONNULL_BEGIN
typedef void(^LocatingCompletionBlock)(CLLocation * __nullable location,
                                       AMapLocationReGeocode * __nullable reGeoCode,
                                       NSError * __nullable error);

typedef void(^SearchPOICompleteBlock)(AMapPOISearchResponse * __nullable response,
                                     NSError * __nullable error);

typedef void(^SearchTipsCompleteBlock)(AMapInputTipsSearchResponse * __nullable response,
                                        NSError *error);

@interface YQLocationManager : NSObject

@property (nonatomic,strong,readonly) CLLocation *userLocaion;
@property (nonatomic,strong,readonly) AMapLocationReGeocode *reGeocode;

/**
 开始定位
 */
- (void)startRequestLocationWithCompletionBlock:(LocatingCompletionBlock)completionBlock;

/**
 搜索周边
 @param pageNo 页码 从1开始计算
 */

- (void)searchAround:(NSInteger)pageNo location:(AMapGeoPoint *)point
                          searchPOICompeteBlock:(SearchPOICompleteBlock)completeBlock;

//- (void)searchUserAround:(NSInteger)pageNo
//   searchPOICompeteBlock:(SearchPOICompleteBlock)completeBlock;

- (void)searchAroundWithRequest:(AMapPOIAroundSearchRequest *)request
          searchPOICompeteBlock:(SearchPOICompleteBlock)completeBlock;

//关键字搜索
- (void)tipsSearch:(NSString *)keywords searchTipsCompleteBlock:(SearchTipsCompleteBlock)tipsComleteBlock;



@end

NS_ASSUME_NONNULL_END
